package com.example.common.entity;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;

@Data
public class LoginInfo implements UserDetails, Serializable {


    private static final long serialVersionUID = -4018195042146911585L;
    private String id;
    private String username;
    private String password;
    private String phone;
    private String role;
    private String roleName;
    private String createTime;
    private String nickname;
    private String avatar;
    private Collection<? extends GrantedAuthority> authorities;

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
